import java.util.Scanner;

//题目：有一分数序列：2/1，3/2，5/3，8/5，13/8，21/13...求出这个数列的前20项之和。
public class Test20 {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);
        System.out.println("请输入一个数");
        int k = console.nextInt();
        double i = 1;
        double j = 2;
        double sum = 0;
        for (int time = 0; time < k; time++) {
            double a = j / i;
            sum += a;
            double m = i + j;
            i = j;
            j = m;
        }
        System.out.println("数列前" + k + "项之和是：" + sum);
    }
}
